package com.itheima.api.treeset.demo05;

import java.util.TreeSet;

public class TreeSetDemo01 {

    public static void main(String[] args) {
        Student s1 = new Student("zhangsan", 23);
        Student s2 = new Student("lisi", 18);
        Student s3 = new Student("wangwu", 20);

        TreeSet<Student> treeSet = new TreeSet<Student>();
        treeSet.add(s1);
        treeSet.add(s2);
        treeSet.add(s3);

        treeSet.forEach(s -> System.out.println(s));

    }

}
